package ru.royalgatemagazine.app.show.main;

public class MainEntity {
	
	public final int mid;
	public final String title;
	public final String text;
	public final int pages;
	public final String image;
	
	private MainEntity(Builder b){
		
		mid = b.mid;
		title = b.title;
		text = b.text;
		pages = b.pages;
		image = b.image;
		
	}
	
	public static class Builder{
		
		public Builder(){}
		
		private int mid = -1;
		private String title = "";
		private String text = "";
		private int pages = -1;
		private String image = "";
		
		public void mid(int mid){this.mid = mid;}
		public void title(String title){this.title = title;}
		public void text(String text){this.text = text;}
		public void pages(int pages){this.pages = pages;}
		public void image(String image){this.image = image;}
		public MainEntity build(){return new MainEntity(this);};
		
	}
	
	@Override
	public String toString() {
		return String.format(
				"MainEntity["+
				"mid:%d, title:%s, text:%s, pages:%d, image:%s]", 
				mid, title, text, pages, image
		);
	}
}
